package com.mini.repository;

import com.mini.model.BusinessOperationRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import java.util.List;

/**
 * @author: zhaocg
 * @created: 2021/01/20 13:55
 */
@Repository
public interface BusinessOperationRecordRepository extends JpaRepository<BusinessOperationRecord, Long>, JpaSpecificationExecutor<BusinessOperationRecord> {

    List<BusinessOperationRecord> findByPhoneNoAndLessonSiteIdOrderByOperationTimeDesc(String phoneNo, Long lessonSiteId);

    Long countByLessonSiteIdAndPhoneNoAndOperationType(Long lessonSiteId,String phoneNo,Integer operationType);

    List<BusinessOperationRecord> findAllByPhoneNoAndLessonSiteIdAndAndOperationTypeIn(String phoneNo,Long lessonSiteId,List<Integer> operationTypes);

}
